<!DOCTYPE html>
<html lang="en">

	<head>
		<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no, minimal-ui" />
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black" />
		<meta name="format-detection" content="telephone=no, email=no" />
		<meta charset="UTF-8">
		<title>优购优品网</title>
		<link rel="stylesheet" href="../css/themes/css/core.css">
		<link rel="stylesheet" href="../css/themes/css/icon.css">
		<link rel="stylesheet" href="../css/themes/css/home.css">
		<link rel="stylesheet" type="text/css" href="../css/vant.css">
		<link rel="stylesheet" type="text/css" href="../css/base.css" />
		<link rel="stylesheet" type="text/css" href="../css/local.css" />
		<script type="text/javascript" src="../script/jquery.js"></script>
		<script type="text/javascript" src="../script/masonry.min.js"></script>
		<script type="text/javascript" src="../script/layer/mobile/layer.js"></script>
		<script type="text/javascript" src="../script/vue.min.js"></script>
		<script type="text/javascript" src="../script/vant.min.js"></script>
		<script type="text/javascript" src="../script/fastclick.js"></script>
		<script type="text/javascript" src="../script/base.js"></script>
		<script type="text/javascript" src="../css/themes/js/aui.js"></script>
		<style>
			.van-nav-bar__title {
				max-width: 70%;
				color: #323233;
			}

			/* .content {
            background: #fff !important;
        } */

			.m-button {
				padding: 0 0.24rem;
			}

			.btn-block {
				text-align: center;
				position: relative;
				border: none;
				pointer-events: auto;
				width: 100%;
				display: block;
				font-size: 1rem;
				height: 2.5rem;
				line-height: 2.5rem;
				margin-top: 0.5rem;
				border-radius: 3px;
			}

			.btn-primary {
				background-color: #04BE02;
				color: #FFF;
			}

			.btn-warning {
				background-color: #FFB400;
				color: #FFF;
			}

			.mask-black {
				background-color: rgba(0, 0, 0, 0.6);
				position: fixed;
				bottom: 0;
				right: 0;
				left: 0;
				top: 0;
				display: -webkit-box;
				display: -webkit-flex;
				display: -ms-flexbox;
				display: flex;
				-webkit-box-pack: center;
				-webkit-justify-content: center;
				-ms-flex-pack: center;
				justify-content: center;
				-webkit-box-align: center;
				-webkit-align-items: center;
				-ms-flex-align: center;
				align-items: center;
				z-index: 999;
			}

			.m-actionsheet {
				text-align: center;
				position: fixed;
				bottom: 0;
				left: 0;
				width: 100%;
				z-index: 1000;
				background-color: #fff;
				-webkit-transform: translate(0, 100%);
				transform: translate(0, 100%);
				-webkit-transition: -webkit-transform .3s;
				transition: -webkit-transform .3s;
				transition: transform .3s;
				transition: transform .3s, -webkit-transform .3s;
			}

			.actionsheet-toggle {
				-webkit-transform: translate(0, 0);
				transform: translate(0, 0);
			}

			.actionsheet-item {
				display: block;
				position: relative;
				font-size: 0.8rem;
				color: #555;
				height: 2rem;
				line-height: 2rem;
				background-color: #FFF;
			}

			.actionsheet-item:after {
				content: '';
				position: absolute;
				z-index: 2;
				bottom: 0;
				left: 0;
				width: 100%;
				height: 1px;
				border-bottom: 1px solid #D9D9D9;
				-webkit-transform: scaleY(0.5);
				transform: scaleY(0.5);
				-webkit-transform-origin: 0 100%;
				transform-origin: 0 100%;
			}

			.actionsheet-action {
				display: block;
				margin-top: .15rem;
				font-size: 0.8rem;
				color: #555;
				width: 25px;
				height: 25px;
				background-image: url('');
				background-repeat: no-repeat;
				background-size: 25px;
				position: absolute;
				top: 10px;
				right: 10px;
			}

			.aui-Address-box-input {
				background: transparent;
			}

			.banner {
				overflow: hidden;
			}

			.banner img {
				width: 100%;
			}

			.my-navbar {
				background-color: #51d0d0 !important;
			}

			.van-search {
				background: transparent !important;
				padding: 0;
			}

			/* .van-search {
				padding: 0;
				border-radius: 20px;
			}

			.van-search__content {
				background-color: #fff;
			} */



			.pp {
				padding: 10px 15px;
				background: #fff
			}

			.p {
				font-size: 24px;
				color: #cd1b21;
			}

			.yk {
				background: rgba(220, 89, 94, 0.1);
				font-size: 12px;
				transform: scale(0.8);
				display: inline-block;
				-webkit-transform-origin-x: 0;
			}

			.s {
				color: #9e9e9e;
				font-size: 14px;

			}

			.nn {
				font-size: 16px;
				font-weight: 700;
				padding: 10px 0;
			}

			.b {
				font-size: 15px;
				color: #9e9e9e;
				padding-bottom: 0;
			}

			.c {
				border-top: 7px solid #f0f2f5;
				padding-bottom: 5px;
			}

			.c img {
				max-width: 100%;
			}

			.ppp {
				border-top: 7px solid #f0f2f5;
			}

			.ppp .van-cell__title,
			.van-cell__value {
				max-width: none;
			}

			.jp-t {
				text-align: center;
				padding: 5px;
				color: #9e9e9e;
			}

			.jp {
				/* padding: 10px 5px; */
				overflow: hidden;
			}

			.jp-r {
				padding: 5px;
				float: left;
				width: 50%;

			}

			.jp-r>div {
				background: #fff;
				border-radius: 6px;
				overflow: hidden;
			}

			.jp-r img {
				width: 100%;
			}

			.jp-r .n {
				line-height: 20px;
				font-size: 14px;
				color: #000;
				margin: 5px 10px;
				overflow: hidden;
				text-overflow: ellipsis;
				display: -webkit-box;
				-webkit-line-clamp: 2;
				-webkit-box-orient: vertical;
				background: #fff;
			}

			.jp-r .p {
				color: #cd1b21;
				font-size: 18px;
				padding: 0 10px 10px;
				background: #fff;
			}

			.min {
				font-size: 12px;
				color: #9e9e9e;
				text-align: center;
				padding: 10px 0 5px 0;
			}

			.min>* {
				vertical-align: middle;
			}

			.car-row {
				padding: 6px 15px;
				border-bottom: 1px solid #e5e5e5;
				overflow: hidden;
				position: relative;
				font-size: 13px;
			}

			.car-row:last-child {
				border-bottom: 0;
			}

			.car-row img {
				width: 34px;
				height: 34px;
				margin-right: 10px;
				display: inline;
			}

			.sp {
				border-top: 7px solid #f0f2f5;
				background: #fff;
				padding: 10px 15px;
			}

			.sp-t {
				padding-bottom: 10px;
				font-size: 14px;
				color: #9e9e9e;
				text-align: center;
			}

			.van-tabs {
				position: absolute;
				left: 0;
				top: 0;
				width: 100%;
				height: 0;
				background: #fff;
				z-index: 99;
				transition: all 0.4s;
				opacity: 0;

			}

			.van-tabs--line .van-tabs__wrap {
				height: 0
			}

			.van-tabs__content {
				display: none;
			}

			.van-tabs__wrap {
				padding-bottom: 5px;
			}

			.bg {
				opacity: 1;
			}

			.bg .van-tabs__wrap {
				height: 44px;
			}
		</style>

	</head>

	<body>
		<div id="app" v-cloak>
			<div class="init-full">
				<!-- <van-nav-bar class="head" :title="productData.ProductName" left-arrow @click-left="onClickLeft">
					<div slot="title" style="padding-top: 8px;">
						<form action="">
							<van-search placeholder="输入编码、品牌、品类、名称搜索" v-model="searchKey" shape="round"
								@search="getCommodity">
							</van-search>
						</form>
					</div>
					<van-icon slot="right" name="shopping-cart-o" size="20px" @click="openCart"></van-icon>
				</van-nav-bar> -->
				<div class="head head-index my-navbar">
					<div class="my-navbar-left-content" @click="onClickLeft">
						<van-icon name="arrow-left" size="20" color="#fff"></van-icon>
					</div>

					<div class="my-navbar-title-content">
						<van-search placeholder="输入编码、品牌、品类、名称搜索" v-model="searchKey" shape="round"
							@search="getCommodity">
						</van-search>
					</div>

					<div class="my-navbar-right-content">
						<van-icon name="shopping-cart-o" size="20px" color="#fff" @click="openCart"></van-icon>
					</div>
				</div>

				<div class="body-with-bottom">
					<van-tabs v-model="tabIndex" @click="changeTab">
						<van-tab title="宝贝"></van-tab>
						<!-- <van-tab title="适配车型"></van-tab> -->
						<van-tab title="详情"></van-tab>
					</van-tabs>

					<div class="content" onScroll="scrollMove()">
						<div class="sw" style="background: #fff;">
							<van-swipe indicator-color="white" :stop-propagation="false" class="banner"
								:style="{height:getImgHeight()}">
								<!-- <van-swipe-item>
                                <video src="http://resource.apicloud.com/video/apicloud3.mp4" height="100px" width="100%"></video>
                            </van-swipe-item> -->
								<van-swipe-item v-if="productData.ImageUrl1" @click.stop="previewImage(0)">
									<img
										:src="productData.ImageUrl1?shoppingMallServerIP + productData.ImageUrl1:'../image/no.png'" />
								</van-swipe-item>
								<van-swipe-item v-if="productData.ImageUrl2" @click="previewImage(1)">
									<img
										:src="productData.ImageUrl2?shoppingMallServerIP + productData.ImageUrl2:'../image/no.png'" />
								</van-swipe-item>
								<van-swipe-item v-if="productData.ImageUrl3" @click="previewImage(2)">
									<img
										:src="productData.ImageUrl3?shoppingMallServerIP + productData.ImageUrl3:'../image/no.png'" />
								</van-swipe-item>
								<van-swipe-item v-if="productData.ImageUrl4" @click="previewImage(3)">
									<img
										:src="productData.ImageUrl4?shoppingMallServerIP + productData.ImageUrl4:'../image/no.png'" />
								</van-swipe-item>
								<van-swipe-item v-if="productData.ImageUrl5" @click="previewImage(4)">
									<img
										:src="productData.ImageUrl5?shoppingMallServerIP + productData.ImageUrl5:'../image/no.png'" />
								</van-swipe-item>
								<!-- <van-swipe-item
                                v-if="!productData.ImageUrl1 && !productData.ImageUrl2 && !productData.ImageUrl3 && !productData.ImageUrl4 && !productData.ImageUrl5">
                                <img src="../image/no.png" />
                            </van-swipe-item> -->
							</van-swipe>
						</div>


						<div class="pp">
							<div class="p" v-show="userInfo"><span
									style="font-size: 14px;">￥&nbsp;</span>{{productData.SalePrice}}&nbsp;<span
									class="yk">一口价</span></div>
							<div class="s" v-show="userInfo">价格&nbsp;<span
									style="text-decoration:line-through;">￥{{productData.MarketPrice}}</span></div>
							<div class="nn">{{productData.ProductName}}</div>
							<div class="b">{{productData.ShortDescription}}</div>
							<div>
								<van-row type="flex" justify="space-around">
									<van-col span="12">
										<div class="min">
											<van-icon name="eye-o" size="14px" color="#9e9e9e"></van-icon>
											<span>浏览数：{{productData.VistiCounts}}</span>
										</div>
									</van-col>
									<van-col span="12">
										<div class="min">
											<van-icon name="cash-back-record" size="14px" color="#9e9e9e"></van-icon>
											<span>成交数：{{productData.ShowSaleCounts}}</span>
										</div>
									</van-col>
								</van-row>
							</div>
						</div>
						<div>
							<van-cell-group>
								<van-cell title="品牌" :value="productData.BrandName"></van-cell>
								<van-cell title="货号" :value="productData.skuname"></van-cell>
								<van-cell title="规格" :value="productData.Unit"></van-cell>
								<van-cell title="类型" :value="productData.CategoryName"></van-cell>
							</van-cell-group>
						</div>
						<div class="ppp">
							<!-- <van-cell is-link @click="openEvaluate">
								<div slot="title">商品评论（{{commentNum}}）</div>
							</van-cell> -->
							<van-cell title="商品详情">
								<!-- <div slot="title">商品详情</div> -->
							</van-cell>
						</div>
						<!-- <div class="sp"> -->
						<!-- <div class="sp-t">适配车型</div> -->
						<!-- <div class="car-row" v-for="row in spCarList">
								<img :src="'http:' + row.FLogo" />
								<span>{{row.FName}}</span>
							</div> -->
						<!-- </div> -->
						<div class="c">
							<div v-html="productData.MobbileDescription"></div>
						</div>
						<div>
							<!-- <div class="jp-t">精品推荐</div> -->
							<van-divider :style="{borderColor: '#c4c4c5'}">相关商品</van-divider>
							<div class="jp">
								<div class="jp-r" v-for="row in relevantList" @click="intoDetail(row)">
									<div>
										<div>
											<img v-lazy="shoppingMallServerIP + row.ThumbnailUrl310" />
											<!-- <van-image width="100%" height="100%" fit="contain"
												:src="shoppingMallServerIP + row.ThumbnailUrl310"></van-image> -->
										</div>
										<div class="n">{{row.ProductName}}</div>
										<div class="p">
											<span style="font-size: 12px;" v-show="userInfo">￥</span><span
												v-show="userInfo">{{row.SalePrice}}</span>
											<span style="font-size: 12px;color: #9e9e9e;">{{row.VistiCounts}}人浏览过</span>
										</div>
									</div>
								</div>
							</div>
						</div>

					</div>



				</div>
				<div class="bottom">
					<van-goods-action style="display: flex;align-items: center;justify-content: flex-end;">
						<!-- <van-goods-action-icon icon="chat-o" text="客服" color="#07c160" @click="openChat">
						</van-goods-action-icon> -->
						<van-goods-action-icon icon="star" :text="collectStatus?'已收藏':'收藏'"
							:color="collectStatus?'#ff5000':'#9e9e9e'"
							@click="toggleCollection"></van-goods-action-icon>
						<van-goods-action-button style="max-width: 200px;" type="warning" text="加入购物车"
							@click="showSKUPart" v-if="productData && productData.Stock > 0">
						</van-goods-action-button>
						<van-goods-action-button style="max-width: 200px;" type="danger" text="立即购买"
							@click="showSKUPart" v-if="productData && productData.Stock > 0"></van-goods-action-button>
						<van-goods-action-button style="max-width: 200px;" type="danger" color="#b3b3b3" text="已售罄"
							v-if="productData && productData.Stock <= 0"></van-goods-action-button>
					</van-goods-action>
				</div>
			</div>
			<van-sku v-model="showSKU" :sku="sku" :goods="goods" :goods-id="goodsId" :initial-sku="initialSku"
				@buy-clicked="onBuyClicked" @add-cart="onAddCartClicked">
				<div slot="sku-stepper">
					<van-cell title="购买数量">
						<div>
							<van-stepper v-model="productData.num" integer step="1" :min="productData.StepNum || 1"
								:max="productData.Stock"></van-stepper>
						</div>
					</van-cell>

				</div>
			</van-sku>

		</div>

	</body>
	<!-- 调用 uniapp webview 的 api ，记得需要写在 body 标签下面 -->
	<script src="../../../assets/script/uni.webview.1.5.4.js"></script>
	<script type="text/javascript">
		var vm;

		var isSLS = false;

		// 处理页面跳锚点
		function scrollMove() {
			if (isSLS) return;
			if ($('.content').scrollTop() > 40) {
				$('.van-tabs').addClass('bg')
			} else {
				$('.van-tabs').removeClass('bg')
			}

			if ($('.content').scrollTop() < $('.sw').offset().top - 40) {
				vm.tabIndex = 0;
			}
			// if ($('.sp').offset().top - $('.sw').offset().top - 40 < $('.content').scrollTop() && $('.content').scrollTop() <
			// 	$('.c').offset().top - $('.sw').offset().top - 40) {
			// 	vm.tabIndex = 1;
			// }
			if ($('.content').scrollTop() > $('.c').offset().top - $('.sw').offset().top - 40) {
				// vm.tabIndex = 2;
				vm.tabIndex = 1;
			}
		}


		//$('.init-full').show();

		// var photoBrowser = api.require('photoBrowser');
		var stepIndex = window.localStorage.getItem('stepIndex') || 1;
		var productData = window.localStorage.getItem('productData') ? JSON.parse(window.localStorage.getItem(
			'productData')) : {};
		productData.num = productData.StepNum;



		Vue.use(vant.Lazyload, {
			loading: '../image/no.png',
			error: '../image/no.png'
		});

		vm = new Vue({
			el: '#app',
			data: {
				showLoading: false,
				showSKU: false,
				serverIP: 'http://' + FLD.serverIP,
				shoppingMallServerIP: 'http://' + FLD.shoppingMallServerIP,
				tabIndex: 0,
				productData: '',
				sku: '',
				goods: '',
				goodsId: '',
				initialSku: '',
				quota: 0,
				collectStatus: 0,
				favoriteId: 0,
				relevantList: [],
				searchKey: '',
				commentNum: 0,
				userInfo: FLD.getUserInfo() || '',
				spCarList: []

			},
			created: function() {
				var that = this;
				var appTop = parseInt(window.localStorage.getItem('safeAreaTop'));
				if (appTop) {
					$('.head').css({
						'padding-top': appTop + 'px',
						'height': appTop + 50 + 'px',
						'line-height': '50px'
					})
				} else {
					$('.head').css({
						'padding-top': appTop + 25 + 'px',
						'height': '75px',
						'line-height': '50px'
					})
				}
				window.localStorage.getItem('searchKey');
				that.getProductData();



			},
			methods: {
				openChat() {
					var that = this;
					// api.sendEvent({
					// 	name: 'openChat'
					// });
				},
				changeTab(name, title) {
					var that = this;
					isSLS = true;
					if (that.tabIndex == 0) {
						$('.content').animate({
							scrollTop: '0px'
						}, 600, function() {
							isSLS = false;
						})
					} else if (that.tabIndex == 1) {
						$('.content').animate({
							scrollTop: ($('.c').offset().top - $('.sw').offset().top - 40) + 'px'
						}, 600, function() {
							isSLS = false;
						});
					}
					// else if (that.tabIndex == 1) {
					// 	// alert($('.sp').offset().top)
					// 	$('.content').animate({
					// 		scrollTop: ($('.sp').offset().top - $('.sw').offset().top - 40) + 'px'
					// 	}, 600, function() {
					// 		isSLS = false;
					// 	});
					// } else if (that.tabIndex == 2) {
					// 	$('.content').animate({
					// 		scrollTop: ($('.c').offset().top - $('.sw').offset().top - 40) + 'px'
					// 	}, 600, function() {
					// 		isSLS = false;
					// 	});
					// }


				},
				getImgHeight() {
					return document.body.offsetWidth + 'px';
					// return api.winWidth + 'px';
				},
				getProductData() {
					var that = this;
					FLD.ajax('sp_getProductDetail', {
						productId: productData.ProductId
					}, function(res) {

						let MobbileDescription = JSON.parse(JSON.stringify(res.ds));

						if (MobbileDescription[0].MobbileDescription && MobbileDescription[0]
							.MobbileDescription.length) {
							MobbileDescription[0].MobbileDescription = MobbileDescription[0]
								.MobbileDescription.replace(/ src="([^"]+)"/g,
									` src="${that.shoppingMallServerIP}$1"`);
						}

						res.ds[0].MobbileDescription = MobbileDescription[0].MobbileDescription;

						that.productData = res.ds[0];
						that.checkCollection(); // 收藏
						that.getCommentNum(); // 评论
						that.addVist();
						that.getRelevant(); // 推荐商品
						// that.SPCar(); // 适配车型

					})
				},
				SPCar() { // 适配车型
					var that = this;
					FLD.ajax('sp_getProductCarBrand', {
						productId: productData.ProductId
					}, function(res) {
						that.spCarList = res.ds;
					})
				},
				getRelevant() { // 推荐商品
					var that = this;
					var obj = {
						productId: that.productData.ProductId,
						num: 6,
						type: 1
					}
					FLD.ajax('sp_relationProduct', obj, function(res) {
						that.relevantList = res.ds;
						that.$nextTick(function() {
							$('.jp img').load(function() {
								$('.jp').masonry({
									itemSelector: '.jp-r',
									isAnimated: true
								});
							})

						})
					})
				},
				previewImage(index) { // 图片预览
					var that = this;
					var imgList = [];
					if (that.productData.ImageUrl1) {
						imgList.push(that.shoppingMallServerIP + productData.ImageUrl1);
					}
					if (that.productData.ImageUrl2) {
						imgList.push(that.shoppingMallServerIP + productData.ImageUrl2);
					}
					if (that.productData.ImageUrl3) {
						imgList.push(that.shoppingMallServerIP + productData.ImageUrl3);
					}
					if (that.productData.ImageUrl4) {
						imgList.push(that.shoppingMallServerIP + productData.ImageUrl4);
					}
					if (that.productData.ImageUrl5) {
						imgList.push(that.shoppingMallServerIP + productData.ImageUrl5);
					}
					// photoBrowser.open({
					// 	images: imgList,
					// 	bgColor: '#000',
					// 	activeIndex: index
					// }, function(ret) {
					// 	if (ret) {
					// 		if (ret.eventType == 'click') {
					// 			photoBrowser.close();
					// 		}
					// 	}
					// })
				},
				getCommentNum() { // 商品评论
					var that = this;
					FLD.ajax('sp_getroductReviews', {
						productId: that.productData.ProductId
					}, function(res) {
						that.commentNum = res.ds.length;
					})
				},
				addVist() {
					var that = this;
					FLD.ajax('sp_insertProductVisit', {
						productId: that.productData.ProductId
					}, function(res) {
						console.log(JSON.stringify(res))
					})
				},
				getCommodity() {
					var that = this;
					// api.openWin({
					// 	name: 'productList',
					// 	url: 'productList.html',
					// 	reload: true,
					// 	slidBackEnabled: false,
					// 	pageParam: {
					// 		searchKey: that.searchKey
					// 	}
					// })
				},
				openCart() {
					var that = this;
					uni.navigateTo({
						url: "/pages/qms/shop/ShopCar?url=shoppingCart"
					});
					// FLD.mustLogin(function() {

					// api.openWin({
					// 	name: 'shoppingCart',
					// 	url: 'shoppingCart.html',
					// 	reload: true,
					// 	slidBackEnabled: false
					// })
					// })

				},
				checkCollection() { // 是否收藏
					var that = this;
					FLD.ajax('sp_IsProductFavorite', {
						productId: that.productData.ProductId
					}, function(res) {
						that.collectStatus = res.ds[0].collectStatus;
						that.favoriteId = res.ds[0].FavoriteId;
					})
				},
				toggleCollection() {
					var that = this;
					FLD.mustLogin(function() {
						if (that.collectStatus) {
							FLD.ajax('sp_deleteFavorite', {
								FavoriteId: that.favoriteId
							}, function(res) {
								that.collectStatus = 0;
								that.favoriteId = 0;
								layer.open({
									content: '收藏夹取消成功!',
									skin: 'msg',
									time: 2
								});
							})
						} else {
							FLD.ajax('sp_addFavorite', {
								productId: that.productData.ProductId
							}, function(res) {
								that.collectStatus = 1;
								that.favoriteId = res.ds[0].FavoriteId;
								layer.open({
									content: '收藏夹添加成功!',
									skin: 'msg',
									time: 2
								});
							})
						}
					})

				},
				showSKUPart() {
					var that = this;

					FLD.mustLogin(function() {
						that.sku = {
							// 所有sku规格类目与其值的从属关系，比如商品有颜色和尺码两大类规格，颜色下面又有红色和蓝色两个规格值。
							// 可以理解为一个商品可以有多个规格类目，一个规格类目下可以有多个规格值。
							tree: [{
								k: '规格', // skuKeyName：规格类目名称
								v: [{
									id: that.productData
										.SkuId, // skuValueId：规格值 id
									name: that.productData
										.SkuId // skuValueName：规格值名称
								}],
								k_s: 's1'

							}],
							// 所有 sku 的组合列表，比如红色、M 码为一个 sku 组合，红色、S 码为另一个组合
							list: [{
								id: that.productData.SkuId,
								price: that.productData.SalePrice * 100, // 价格（单位分）
								s1: that.productData.SkuId, // 规格类目 k_s 为 s1 的对应规格值 id
								s2: '0', // 规格类目 k_s 为 s2 的对应规格值 id
								s3: '0', // 最多包含3个规格值，为0表示不存在该规格
								stock_num: that.productData.Stock // 当前 sku 组合对应的库存
							}],
							price: that.productData.SalePrice, // 默认价格（单位元）
							stock_num: that.productData.Stock, // 商品总库存
							collection_id: that.productData
								.SkuId, // 无规格商品 skuId 取 collection_id，否则取所选 sku 组合对应的 id
							none_sku: true, // 是否无规格商品
						};
						that.goods = {
							// 商品标题
							title: that.productData.ProductName,
							// 默认商品 sku 缩略图
							picture: that.productData.ImageUrl1 ? (that.shoppingMallServerIP +
								that.productData.ImageUrl1) : '../image/no.png',
						}
						that.goodsId = that.productData.ProductId;

						that.initialSku = {
							s1: that.productData.SkuId
						}
						that.showSKU = true;
					})



				},
				onAddCartClicked(skuData) {
					var that = this;
					var obj = {
						productId: skuData.goodsId,
						skuId: skuData.selectedSkuComb.id,
						quantity: parseInt(that.productData.num)
					}
					console.log(JSON.stringify(obj))
					FLD.ajax('sp_addShoppingCarts', obj, function(res) {
						console.log(JSON.stringify(res))
						layer.open({
							content: '商品添加成功',
							skin: 'msg',
							time: 2
						});
						that.showSKU = false;
					})
				},
				onBuyClicked(skuData) {
					return vant.Toast.fail('暂未开通')

					var that = this;
					var commodityList = [{
						productId: skuData.goodsId,
						quantity: parseInt(that.productData.num),
						price: (skuData.selectedSkuComb.price / 100).toFixed(2),
						skuId: skuData.selectedSkuComb.id,
						image: that.productData.ThumbnailUrl160,
						name: that.productData.ProductName,
					}]


					window.location.href = './submitOrder.html';
					window.localStorage.setItem('commodityList', JSON.stringify(commodityList))
					// window.localStorage.setItem('formType', '购物车')
					// api.openWin({
					// 	name: 'submitOrder',
					// 	url: 'submitOrder.html',
					// 	reload: true,
					// 	slidBackEnabled: false,
					// 	pageParam: {
					// 		commodityList: commodityList

					// 	}
					// })
				},
				openEvaluate() {
					var that = this;
					// api.openWin({
					// 	name: 'evaluateOrderList',
					// 	url: 'evaluateOrderList.html',
					// 	reload: true,
					// 	slidBackEnabled: false,
					// 	pageParam: {
					// 		ProductId: that.productData.ProductId
					// 	}
					// })
				},
				intoDetail(row) {
					var that = this;
					// stepIndex++;

					window.localStorage.setItem('productData', JSON.stringify(row))
					window.localStorage.setItem('stepIndex', JSON.stringify(stepIndex))
					location.reload();
					// window.location.href = './product.html'
					// api.openWin({
					// 	name: 'product' + stepIndex,
					// 	url: 'product.html',
					// 	reload: true,
					// 	slidBackEnabled: false,
					// 	pageParam: {
					// 		productData: row,
					// 		stepIndex: stepIndex
					// 	}
					// })
				},
				onClickLeft() {
					// api.closeWin();
					window.localStorage.removeItem('productData');
					window.localStorage.removeItem('stepIndex');
					window.history.back();
				}
			}
		})
	</script>

</html>